package com.zhanghs.contentcenter.dto;

import lombok.Builder;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Author zhanghongshan
 * @date 2021/10/3 11:56 上午
 */
@Data
@Builder
public class ContentDTO implements Serializable {
    @NotNull(message = "姓名不能为空")
    private String name;
    @Range(max = 130,min = 0,message = "年龄最大130，最小0")
    private Integer age;

    public ContentDTO(String name,Integer age) {
        this.name = name;
        this.age = age;
    }
}
